import React from "react";

interface Props {
  itemList: string[];
  handleClear: () => void;
}

const BuyCar = ({ itemList, handleClear }: Props) => {
  return (
    <div>
      <h1>我是购物车</h1>
      <ul>
        {itemList.map((item) => {
          return <li key={item}>{item}</li>;
        })}
      </ul>
      <button onClick={handleClear}>clear</button>
    </div>
  );
};

export default BuyCar;
